<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>{$site_title}-注册</title>
	<link href="{url:#qhf/font/iconfont.css}" rel="stylesheet"/>
	<link href="{url:#qhf/lian.css}" rel="stylesheet" type="text/css"/>

	<link href="{url:#css/bootstrap.css}" rel="stylesheet" type="text/css"/>
	<script src="{url:#js/jquery.min.js}"></script>
	<script src="{url:#js/bootstrap.js}"></script>



</head>
<body class="y-body">
<div class="container">
	<div class="logo" style="top:0px;left:302px;">
		<a href="{url:/index/index}">
			<img src="{url:@$site_logo}" alt="logo" width="155px" height="76px">
		</a>
		<!--<span class="logo-text">商城</span>-->
	</div><!--logo结束-->
	<div class="y-container">
		<form action="{url:/simple/reg_act}" method="post" id="reg_form">
			<div class="y-container-et">
				<div class="y-container-at">
					<h4 class="y-container-at1"><a href="#" style="font-size:25px;">用户注册</a></h4>

					<h5 class="y-container-at2"><a href="{url:/simple/login}">会员登录</a></h5>

				</div><!--y-container-at结束-->


				<div class="d-container-bt" id="div_msg" style="font-size:16px;color:red;width:310px;height:20px;text-align:center;line-height:20px;margin-top:10px;">
				</div>

				<div class="y-container-qt">
					<div class="y-container-left">
						<i class="iconfont icon-shoujihao"></i>
					</div><!--y-container-left结束-->
					<div class="y-container-right">
						<input type="text" class="y-container-right-1" name="tjr_name" id="tjr_name" value="{$tjr_number}" placeholder="推荐人">
					</div><!--y-container-right结束-->
					<!--
                   <div class="y-container-bt">
                       格式不正确！
                   </div>
                   -->
				</div><!--y-container-qt结束-->
				<div class="y-container-qt">
					<div class="y-container-left">
						<i class="iconfont icon-shoujihao1"></i>
					</div><!--y-container-left结束-->
					<div class="y-container-right">
						<input type="text" name="uname" id="uname" class="y-container-right-1" placeholder="请输入用户名">
					</div><!--y-container-right结束-->
				</div><!--y-container-qt结束-->
				<div class="y-container-qt">
					<div class="y-container-left">
						<i class="iconfont icon-mima"></i>
					</div><!--y-container-left结束-->
					<div class="y-container-right">
						<input type="password" name="password" id="password" class="y-container-right-1" placeholder="请输入登录密码">
					</div><!--y-container-right结束-->
				</div><!--y-container-qt结束-->
				<div class="y-container-qt">
					<div class="y-container-left">
						<i class="iconfont icon-mima1"></i>
					</div><!--y-container-left结束-->
					<div class="y-container-right">
						<input type="password" name="passwordtwo" id="passwordtwo" class="y-container-right-1" placeholder="请输入交易密码">
					</div><!--y-container-right结束-->
				</div><!--y-container-qt结束-->

				<div class="y-container-qt">
					<div class="y-container-left">
						<i class="iconfont icon-shoujihao"></i>
					</div><!--y-container-left结束-->
					<div class="y-container-right">
						<select pattern="required" name="agent" id="proxy_type" alt="请选择类别" style="width:285px;height: 40px;">
							<option value="">请选择投资级别</option>
							{query:name=grade}
							<option value="{$item['id']}">{$item['name']}</option>
							{/query}
						</select>
					</div><!--y-container-right结束-->
				</div>
				<div class="y-container-qt">
					<div class="y-container-right" style="width:400px;">
						<select  id="province" name ="province">
							<option value="0">==省份/直辖市==</option>
							{query:name=area  where=parent_id eq 0}
							<option value="{$item['id']}">{$item['name']}</option>
							{/query}
						</select>
						<select id="city" name="city">
							<option value="0">==市==</option>
						</select>
						<select id="county" name="county">
							<option value="0">==县/区==</option>
						</select>
					</div><!--y-container-right结束-->
				</div>

				<!--<div class="y-container-qt">-->
					<!--<div class="y-container-left">-->
						<!--<i class="iconfont icon-duanxinyanzheng"></i>-->
					<!--</div>&lt;!&ndash;y-container-left结束&ndash;&gt;-->
					<!--<div class="y-container-right-3">-->
						<!--<input type="text" name="validate_code" id="validate_code" class="y-container-right-2" style="border:1px solid #c2c2c2;height:38px;" placeholder="手机验证码">-->
						<!--&nbsp;-->
						<!--<input type="button" onclick="get_validate_code()" value="获取手机验证码" style="cursor:pointer;width:118px;height:38px;color:#fff;font-size:13px;border:1px solid red;font-weight: bold ;background-color:#f35035;margin-left:-12px;"/>-->
						<!--&lt;!&ndash;-->
                        <!--<div class="y-container-right-mit">-->
                            <!--获取手机验证码-->
                        <!--</div>-->
                        <!--&ndash;&gt;-->
					<!--</div>&lt;!&ndash;y-container-right结束&ndash;&gt;-->

				<!--</div>-->
				<!--
                <div class="y-container-qt">
                    <div class="y-container-left">
                        <i class="iconfont icon-duanxinyanzhengma"></i>
                    </div>
                    <div class="y-container-right-3">
                        <input type="text" name="verifyCode" id="verifyCode" class="y-container-right-2" style="border:1px solid #c2c2c2;height:38px;" placeholder="请输入验证码">
                    </div>
                    <div class="y-container-right-mid">
                          <a href="javascript:void(0)" class="red" onclick="document.getElementById('captcha_img').src='{url:/simple/captcha/h/40/w/100/bc/f1f1f1/random/}'+Math.random()">
                           <img id="captcha_img"  src="{url:/simple/captcha/h/34/w/100/bc/f1f1f1}">
                       </a>


                    </div>
                </div>
                -->

				<div class="y-container-qt">
					<div	class="y-container-nt">
						<input type="checkbox" id="chk_read_me">我已阅读并同意 &lt;&lt;<a id="user-license" style="color:red;" href="javascript:;"> {$site_title}用户注册协议 </a>&gt;&gt;
					</div><!--y-container-nt-->
				</div><!--y-container-qt结束-->
				<div class="y-container-qt" style="margin-top:10px;">
					<button type="button" class="y-container-btn" style="background:red;cursor:pointer;" id="btn_reg">立即注册</button>
				</div><!--y-container-qt结束-->
			</div><!--y-container-et结束-->
			{token:key=reg}
		</form>
	</div><!--y-container结束-->
	<div class="y-footer">
		<div class="y-footer-lt">
			<ul>
				<li><a href="#">关于我们</a>&nbsp;|</li>
				<li><a href="#">联系我们</a>&nbsp;|</li>
				<li><a href="#">人才招聘</a>&nbsp;|</li>
				<li><a href="#">商家入驻</a>&nbsp;|</li>
				<li><a href="#">广告服务</a>&nbsp;|</li>
				<li><a href="#">手机创云</a>&nbsp;|</li>
				<li><a href="#">友情链接</a>&nbsp;|</li>
				<li><a href="#"></a>销售联盟&nbsp;</li>
			</ul>
		</div><!--y-footer-lt结束-->
		<!--
        <div class="y-footer-mt">
            Copyright © 2017 汇圆版权所有
        </div>
        -->
		<div class="y-footer-rt">
			<ul>
				<li><img src="{url:#qhf/image/c.jpg}" alt=""></li>
				<li><img src="{url:#qhf/image/b.jpg}" alt=""></li>
				<li><img src="{url:#qhf/image/d.jpg}" alt=""></li>
			</ul>
		</div><!--y-footer-rt结束-->
	</div><!--footer结束-->
</div><!--container结束-->




<!--
<div id="license-content" style="display:none;">
    <div style="height:400px;overflow:auto">
    {query:name=help where=id eq 14}
    {$item['content']}
    {/query}
    </div>
    <div class="mt10 tc"><a href="javascript:closeLicense();" class="btn btn-main">同意用户注册协议</a></div>
</div>
-->


<div class="modal fade" id="myModal_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel">注册协议：</h4>
			</div>
			<div class="modal-body" id="myModalContent">
				<div class="form-horizontal" data-validate="parsley">
					{query:name=help where=id eq 14}
					{$item['content']}
					{/query}
					<!--
                    <section class="panel panel-default">

                        <div class="panel-body">

                        </div>
                    </section>
                    -->
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>



<script type="text/javascript">
	{if:!empty($invalid)}
	$("#div_msg").text("{$invalid[msg]}")
	{/if}

	function show_msg( msg )
	{
		$("#div_msg").text(msg);
		setTimeout(function(){
			$("#div_msg").text('');
		},3000);
	}

	$("#user-license").on("click",function(){
		$("#myModal_1").modal();
	});

	$("#btn_reg").click(function()
	{
		//推荐编码
//		var number        = $.trim( $("#number").val() );
//		var uname         = $.trim( $("#uname").val() );
//		var password      = $.trim( $("#password").val() );
//		var passwordtwo   = $.trim( $("#passwordtwo").val() );

//		var validate_code = $.trim( $("#validate_code").val() );
		//var verifyCode    = $.trim( $("#verifyCode").val() );

//		if(number == '')
//		{
//			show_msg('推荐人不能为空');
//			return;
//		}
		/*
		 if(number != '')
		 {
		 var pattern = /^\w{6}$/i;
		 if(!pattern.test( number ))
		 {
		 show_msg('您输入的推荐编码不合法');
		 return;
		 }
		 }
		 */

//		if(uname == '')
//		{
//			show_msg('用户名不能为空');
//			return;
//		}
//		var pwd_pattern = /^\w{6,20}$/i;
//		if(password == '')
//		{
//			show_msg('登录密码不能为空');
//			return;
//		}
//
//		if(!pwd_pattern.test( password ))
//		{
//			show_msg('您输入的登录密码不合法');
//			return;
//		}
//
//		if(passwordtwo == '')
//		{
//			show_msg('交易密码不能为空');
//			return;
//		}
//
//		if(!pwd_pattern.test( passwordtwo ))
//		{
//			show_msg('您输入的交易密码不合法');
//			return;
//		}


//		if(validate_code == '')
//		{
//			show_msg('短信验证码不能为空');
//			return;
//		}

//		if(!(/^\d{6}$/.test( validate_code )))
//		{
//			show_msg('您输入的短信验证码不合法');
//			return;
//		}

		/*
		 if(verifyCode == '')
		 {
		 show_msg('验证码不能为空');
		 return;
		 }

		 if( !(/^[a-z]{4}$/.test(verifyCode)) )
		 {
		 show_msg('您输入的验证码不合法');
		 return;
		 }
		 */

		if( !$("#chk_read_me").prop('checked') )
		{
			show_msg('您必须选择同意用户注册协议');
			return;
		}

		$("#reg_form").submit();
	});



	function get_validate_code()
	{
		var mobile = $.trim($("#uname").val());
		if(mobile == '')
		{
			alert('手机号码不能为空');
			return;
		}
		var mobile_pattern = /^1[3-9]\d{9}$/;
		if(!mobile_pattern.test(mobile))
		{
			alert('手机号码不合法');
			return;
		}

		$("#btn_get_validate").attr("disabled", true);
		$.post("{url:/simple/sms_send}",{mobile:mobile},function(result){
			alert(result);
			$("#btn_get_validate").attr("disabled", false);
		});
	}


</script>
<script type="text/javascript">
	$('#proxy_type').change(function(){
		$("#province").removeAttr('disabled');
		$("#city").removeAttr('disabled');
		$("#county").removeAttr('disabled');

		var u_lx = $(this).val();
		if (u_lx == 1 || u_lx == 2) {
			$("#province").attr('disabled',true).val(0);
			$("#city").attr('disabled',true).val(0);
			$("#county").attr('disabled',true).val(0);
		} else if (u_lx == 4) {
			$("#county").attr('disabled',true).val(0);
		}
	});


	$(function(){
		$("#province").change(function(){
			var id = $(this).val();

			if(id == 0)
			{
				$("#city").html("<option value='0'>==市==</option>");
				$("#county").html("<option value='0'>==县/区==</option>");
			}
			else
			{
				$.post("{url:/simple/transform}",{id:id},function(data){
					$("#city").html("<option value='0'>==市==</option>");
					$("#county").html("<option value='0'>==县/区==</option>");
					$("#city").append(data);
				},'text');
			}

		});

		$("#city").change(function(){
			var id = $(this).val();
			if(id == 0)
			{
				$("#county").html("<option value='0'>==县/区==</option>");
			}
			else
			{
				$.post("{url:/simple/transform}",{id:id},function(data){
					$("#county").html("<option value='0'>==县/区==</option>");
					$("#county").append(data);
				},'text');

			}

		})

	});
</script>

</body>
</html>

